package com.bzm.common.entity;

/**
 * @Description:http枚举
 * @author hemiao
 * @time:2019年12月22日 下午9:35:21
 */
public enum HttpCode {
	
	/**
	 * 200,"成功"
	 */
    SUCCESS(200,"succee"),
    	
    /**
     * 119,"失败"
     */
    FAILURE(119,"failure"),

    /**
     *120, "内部错误" 
     */
    ERROR(120, "内部错误"),
    
    /**
     * 500,"系统繁忙"
     */
    EXCEPTIONS(500,"系统繁忙"),

    /**
     * 19451025,"参数验证失败" 【1945.10.25 台湾光复 抗战胜利】
     */
    PARAM_VERIFICATION(19451025,"参数验证失败"),
    
    /**
     * 19450815, "操作权限不足,请联系管理员"  【1945.08.15 日本政府被迫宣布无条件投降】
     */
    NO_OPERATION_PERMISSION(19450815, "操作权限不足,非法操作"),
    
    /**
     * 19450902, "登录已失效,请重新登录" 【1945.09.02 日本签署投降书】
     */
	NOT_LOGIN(19450902, "登录已失效,请重新登录"),
	
	
	NOT_BIND_PHONE(400000, "未绑定手机号"),
	
	
	NOT_IDCARD(400002, "未实名认证"),
	
	/**
     * 数据不存
     */
	NOT_DATA(000000, "数据不存在"),
	
	DATA_DELETE(4444,"数据删除"),
	
	DATA_FEEDBACK_MAX(4445,"一天可提交3次"),

	IM_CONNECT(1,"第一次(或重连)初始化连接"),
	
	HEART_BEAT(4, "客户端心跳"),
	
	IM_PUBLISH_WANT(5, "宠物发布想要"),
	
	IM_SEND_MSG(6, "发送消息"),
	
	IM_RECEIVE_MSG(7, "收到消息"),
	
	MSG_LOGS(8, "消息记录"),
	
	SESSION_LOGS(9, "会话列表"),
	
	IM_RECEIVE_SESSION(10, "收到会话"),
	
	;
	
    public static String getCodeMsg(Integer code) {
        for (HttpCode hc : HttpCode.values()) {
            if (hc.getCode().equals(code)) {
                return hc.getMsg();
            }
        }
        return "";
    }

    private Integer code;

    private String msg;
    
    private HttpCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
